<?php
class Tson
{
	private function __construct( $source )
	{
		$this->setSource( $source );
	}
	public function __destruct()
	{
		
	}
	private function __clone()
	{
		trigger_error( 'System Error!', E_USER_ERROR );
	}
	
	public static function getInstance( $source )
	{
		echo $source;
    	if( !isset( self::$instance ) ){
    		self::$instance = new Tson( $source );
    	}
    	return self::$instance;
	}
	public function setSource( $source )
	{
		$this->source = self::TSON_DIR.'tson_'.$source.'.tson';
	}
	public function getInfo()
	{
		return unserialize( file_get_contents( $this->source ) );
	}
	public function setInfo( $info )
	{
		file_put_contents( $this->source, serialize( $info ) );
	}
	
	private static $instance;
	private $source;
	private $content;
	const TSON_DIR = DIR_TEMPLATE;
}
?>